<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="circle_style.css"/>
 </head>
<body>
    <div id="content" style="width: 90%; position: relative; margin-left: 5%;height: 500px;border: 3px; border-radius: 10px;background-color: white">
        <input type="text" placeholder="请输入标题" style="color: grey;width: 90%;height: 50px;margin-left: 5%">
        <div id="guo" aria-placeholder="请输入正文" style="color: grey;height:300px;width: 90%;margin-left: 5%" contenteditable="true"></div>
    </div>

</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/jquery.js"></script>
<script type="text/javascript" src="../../script/aui-tab.js"></script>
<script type="text/javascript">
    apiready = function(){
        api.parseTapmode();
        api.addEventListener({
            name:'photoSelected'
        },function (ret,error) {
            var s = ret.value.path;
            s = s.replace(/"/g,"");
            s = s.replace(/\\/g,"");
            /*
            document.getElementById('content').innerHTML= document.getElementById('content').innerHTML+"<img src = "+JSON.stringify(s)+' ' +
                'style:"float:left;width:90%;height:100px;margin-left:5%;margin-top:20px;"" />'
                */
            document.getElementById('guo').innerHTML=document.getElementById('guo').innerHTML+"<image src="+JSON.stringify(s) + "style:\"width=100% \" />";
        })
    };
    function postStrategy() {
       json = {
            "app_version":"",
            "user_id":"",
            "cookie":"",
            "title":"title",
            "tag_id_list":"1,2,3",
    "content":"content",
            "is_anonymous":0,
            "img_list":[]
        }
        alert('hh')
        $.ajax({
            url:'http://1.82.238.228:80/api/group/postArticle/',
            type:'POST',
            data:JSON.stringify(json),
            // crossDomain: true,
            dataType: 'json',
            success:function (ret) {
                alert(JSON.stringify(ret))
            }
        })
    }
    function closeWin(){
        api.closeWin({
        });
    }
</script>
</html>